package com.tiancheng.trade.payment.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tiancheng.trade.commom.core.data.PageInfo;
import com.tiancheng.trade.payment.enums.ChannelRefundTypeEnum;
import com.tiancheng.trade.payment.enums.FlowStatusEnum;
import com.tiancheng.trade.payment.model.IntFlowDetail;
import com.tiancheng.trade.payment.vo.api.PaypalCreateReqVO;
import com.tiancheng.trade.payment.vo.api.QueryFlowDetailVO;

import java.util.List;
import java.util.Map;

/**
 * 英文版支付流水明细业务接口
 *
 */
public interface IntFlowDetailService {
    /**
     * 保存支付流水明细
     *
     * @param flowId
     * @param paymentId
     * @param paypalCreateReqVO
     * @return
     */
    int save(String flowId, String paymentId, PaypalCreateReqVO paypalCreateReqVO);

    /**
     * 查询流水明细
     *
     * @param queryFlowDetailVO
     * @return
     */
    PageInfo find(QueryFlowDetailVO queryFlowDetailVO);



    /**
     * 流水明细批量更新-所更新字段值相同
     *
     * @param ids       id
     * @param colValMap 字段-值：(column, value)
     * @return
     */
    int updateSettleBatch(List<Long> ids, Map<String, Object> colValMap);

    /**
     * 根据flow_id 查询
     *
     * @param flowId
     * @return
     */
    List<IntFlowDetail> findByFlowId(String flowId);


    /**
     * 修改子订单退款状态
     * @param flowId
     * @param subOrderId
     * @param refundType
     * @param flowStatusEnum
     * @return
     */
    Integer updateRefundStatus(String flowId, String subOrderId, ChannelRefundTypeEnum refundType,
                               FlowStatusEnum flowStatusEnum);


    /**
     * 设置订单实付金额
     *
     * @param flowId
     * @param couponAmount
     * @return
     */
    int updateAmount(String flowId, Integer couponAmount);

    /**
     * 批量查询
     *
     * @param condition
     * @return
     */
    List<IntFlowDetail> selectList(QueryWrapper<IntFlowDetail> condition);


}
